package p2p.model.vo
{
	import flash.utils.ByteArray;

	public class P2PSharedVO
	{
		public var descriptor:DescriptorVO;
		public var data:ByteArray;
		public var chunks:Object = new Object();
		private var receivedChunksCount:uint = 0;
		
		public function PSPSharedVO() : void
		{
			chunks = new Object();
		}
		
		public function setChunkData(chunkIdx:int, chunkData:Object) : void
		{
			chunks[chunkIdx] = chunkData;
			++receivedChunksCount;
			descriptor.bytesLoaded = receivedChunksCount * descriptor.packetSize;
		}
		
		public function getChunkData(chunkIdx:int) : Object
		{
			return chunks[chunkIdx];
		}
	}
}